﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using TjZheng.Framework;
using TjZheng.Power.Business;
using TjZheng.Power.DataEntity;

namespace TjZheng.WebApi.Test.Controllers
{
    public class BtnApiController : ApiController
    {
        BizButtonInfo objBizButtonInfo { get; set; }
        public BtnApiController()
        {
            objBizButtonInfo = new BizButtonInfo();
        }
        public IEnumerable<ButtonInfo> Get()
        {
            return objBizButtonInfo.GetList("");
        }
        public ButtonInfo Get(long id)
        {
            ButtonInfo objButtonInfo = new ButtonInfo();
            if (id > 0)
            {
                objButtonInfo = objBizButtonInfo.GetRecord(id);
            }
            return objButtonInfo;
        }
        public InvokeResult Post([FromBody]ButtonInfo objButtonInfo)
        {
            return new InvokeResult { ResultMessage = "保存成功" };
        }

        public InvokeResult Delete(long id)
        {
            return new InvokeResult { ResultMessage = "删除成功" };
        }
    }
}
